package BNS.kingPawn;

import java.io.Serializable;
import BNS.plumbing.*;
import BNS.graphs.*;

/** A class used by MarketISGame to hold all data pertinent to a particular player
	(aka Client) (aka ClientLiaison).
	*/
public class NodeState implements java.io.Serializable {
	transient ClientLiaison client;
	/** an array built to make access to this node's neighbours fast and direct */
	EdgeState[] edgeStates;	// subsets of state
	/** holds an indicator of who this node is fighting.
		If not fighting anyone, then it is -1.
		If fighting n>1 neighbours, then it is -n.
		*/
	int fights;	
	/** index of this node; see calcWinStatus for definition of winStatus; role is one of king or pawn */
	int index, winStatus, role;
	/** tipping fraction, 
		present pay rate if this node were a king, 
		present pay rate if this node were a king, 
		pay accumulated so far in this game
		*/
	float tFrac, kRate, pRate, payRate, cumulativePay;
	/** last millisecond date at which this node got his pay calculated */
	long lastPayDate;
	
	/** constructor giving default values to various variables. 
		@param idx the graph's index of the node for which this object is being created. */
	public NodeState(int idx) {
		index=idx; winStatus=1; cumulativePay=0.f; lastPayDate=0L; }
	}
